{  Statement: http://acmp.ru/?main=task&id_task=106
   Verdict: Accepted
}
uses
    SysUtils, Math;

var
    n,i,k,x,y:longint;

begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
x := 0;
y := 0;
for i:=1 to n do begin
    read(k);
    if k = 0 then inc(x) else inc(y);
end;
write(n - max(x,y));
end.